package com.javafm.devices.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@FeignClient(name = "park", fallback = ParkClient.ParkClientFallback.class)
public interface ParkClient {

    @GetMapping("/park-list")
    String parkList();

    @Component
    static class ParkClientFallback implements ParkClient {
        @Override
        // 对应的方法，如果产生服务降级就可以到这里来
        public String parkList() {
            return "哎哟~挤爆了";
        }
    }
}
